feat(ble): expose advertised service UUIDs on MidiDevice - #168
Open
mortenboye wants to merge 1 commit into
Open
Conversation
Adds `MidiDevice.serviceUUIDs`, populated from the universal_ble scan result, so apps can narrow BLE discovery beyond the MIDI service filter to specific hardware. UUIDs are normalized to lowercase 128-bit strings because the Linux and Web backends pass advertisement UUIDs through raw. An advertisement without a service list does not clear previously seen UUIDs, since advertisement and scan-response packets arrive separately and only one of them carries the list. Reimplements the idea from #134 by @LEggcookies, whose original patch targeted the pre-federation native Android/iOS code that no longer exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplements the feature proposed in #134 by @LEggcookies for the current federated /
universal_blearchitecture. The original patch targeted the pre-federation native Android/iOS sources, which no longer exist — credit for the idea is theirs.What
MidiDevice.serviceUUIDsexposes the service UUIDs a BLE peripheral advertised, so an app can narrow discovery beyond the MIDI service filter to specific hardware:Notes
BleUuidParser. The pigeon-backed platforms already do this, but Linux and Web pass advertisement UUIDs through raw; normalizing keeps the field comparable everywhere. Unparseable entries are dropped.const []default, so theMidiDeviceconstructor and all subclasses stay source-compatible.Tests
Four new cases in
packages/flutter_midi_command_ble/test/(exposure, normalization, empty-advertisement retention, replacement), plus an assertion in the platform-interface test pinning the empty-for-host-devices contract.flutter analyzeclean; BLE, platform-interface and root suites pass.Closes #134